﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="Sun, 1 Jan 2000 01:00:00 GMT" />

<title></title>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script type="text/javascript" src="/js/base.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.hotkeys.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $(".close").click(function() {
            $(this).parent().hide("slow");
        });

        $(".asset_table tr:odd").addClass("alt");
        $(".zebra_even tr:even").addClass("alt");
        /*
        setInterval("get_unread()", 6000);

        jQuery.hotkeys.add('h', function (){window.location="/"});
        jQuery.hotkeys.add('a', function (){window.location="/asset/add/"});
        jQuery.hotkeys.add('c', function (){window.location="/message/compose/"});
        jQuery.hotkeys.add('p', function (){window.location="/post/"});
        jQuery.hotkeys.add('x', function (){window.location="/logout/"});
        */

    });

    function get_unread() {
        /*
        $.post("/message/unread/", function(data) {
            if(data == "0") {
                $(".unread").text("");
            }
            else {
                $(".unread").text("(" + data + "封未读)");
            }
        });
        */
    }


        $(document).ready(function() {
        $("#country").change(function() {
            $.post("/setting/get_states/", {country:$(this).val()}, function(data) {
                var list = eval('(' + data + ')');

                $("#state").empty();
                $("#city").empty();

                $("#state").append('<option value="0">省和直辖市&nbsp;&nbsp;&nbsp;</option>');
                $("#city").append('<option value="0">城市&nbsp;&nbsp;&nbsp;</option>');

                for(i in list) {
                        if(i == 0) {
                            $("#state").append('<option value="' + list[i].id + '" selected>' + list[i].name + '</option>');
                        }
                        else {
                            $("#state").append('<option value="' + list[i].id + '">' + list[i].name + '</option>');
                        }
                }

                $("#state")[0].selectedIndex = 0;
                $("#city")[0].selectedIndex = 0;
            });
        });

        $("#state").change(function() {
            $.post("/setting/get_cities/", {state:$(this).val()}, function(data) {
                var list = eval('(' + data + ')');
                $("#city").empty();

                $("#city").append('<option value="0">城市&nbsp;&nbsp;&nbsp;</option>');

                for(i in list) {
                    if(i == 0) {
                        $("#city").append('<option value="' + list[i].id + '" selected>' + list[i].name + '&nbsp;&nbsp;&nbsp;</option>');
                    }
                    else {
                        $("#city").append('<option value="' + list[i].id + '">' + list[i].name + '&nbsp;&nbsp;&nbsp;</option>');
                    }
                }

                $("#city")[0].selectedIndex = 0;
            });
        });
    });



    function verify() {
        var email = $("#email").val();
        var password = $("#password").val();
        var password0 = $("#password0").val();
        var name = $("#name").val();
        var feedback = $("#feedback");

        $(".errmsg").remove();


        if(email.indexOf("@") == -1 || email.indexOf(".") == -1) {
            feedback.append('<p class="errmsg">请输入有效的email地址</p>');
            return false;
        }


        if(password == "" || password != password0) {
            feedback.append('<p class="errmsg">密码为空或两次输入不一致</p>');
            return false;
        }

        if(name == "") {
            feedback.append('<p class="errmsg">请输入昵称</p>');
            return false;
        }

        submitting();
        return true;
    }

</script>
</head>
<body bgcolor="#ffffff">
<a name="top"></a>
<table width="960px" align="center">
    <tr valign="bottom">
        <td align="right" width="100%">

        <table width="100%">
            <tr align="right">
                <td colspan="2">
                    <a href="/login/">登录</a>&nbsp;|
                    <a href="/register/">注册</a>
                </td>
            </tr>
            <tr class="dotted_bottom">
                <td align="left" valign="bottom" rowspan=2>
                    &nbsp;&nbsp;
                    <a href="/"><span class="h2">首 页</span></a>&nbsp;&nbsp;
                </td>
            </tr>
        </table>

        </td>
    </tr>
</table>
<table class="content" width="960px" align="center" cellspacing="20px">

    <tr>
        <td>
            <span class="title">新用户注册 . . .</span>
        </td>
        <td width="300px">&nbsp;</td>
    </tr>
    <tr>
        <td valign="top">
            <form name="register" method="post" action="/register/" onsubmit="return verify();">

            <table>
            <tr>
                <td align="right">Email&nbsp;</td>
                <td>

                    <input id="email" class="graybox" name="email" type="text"
                        maxlength="64" size="30" value="" />&nbsp;&nbsp;*

                </td>
            </tr>
            <tr>
                <td align="right">用户密码&nbsp;</td>
                <td>
                    <input id="password" class="graybox" name="reg_password" type="password"
                        maxlength="32" size="20" value="" />&nbsp;&nbsp;*
                </td>
            </tr>
            <tr>
                <td align="right">确认密码&nbsp;</td>
                <td>
                    <input id="password0" class="graybox" name="reg_password0" type="password"
                        maxlength="32" size="20" value="" />&nbsp;&nbsp;*
                </td>
            </tr>
            <tr>
                <td align="right">昵称&nbsp;</td>
                <td>
                    <input id="name" class="graybox" name="reg_name" type="text" maxlength="32"
                        size="20" value="" />&nbsp;&nbsp;*
                </td>
            </tr>
            <tr><td>&nbsp;</td></tr>
            <tr>
                <td align="right">所在地&nbsp;</td>
                <td>
                    <select id="country" class="graybox" name="country" size=1>
                        <option value="0">国家和地区&nbsp;&nbsp;&nbsp;</option>

                        <option value="1" >中国（大陆）</option>

                        <option value="2" >台湾</option>

                        <option value="3" >香港</option>

                        <option value="4" >澳门</option>

                        <option value="5" >美国</option>

                        <option value="6" >澳大利亚</option>

                    </select>&nbsp;
                    <select id="state" class="graybox" name="state" size=1>
                        <option value="0">省和直辖市&nbsp;&nbsp;&nbsp;</option>

                    </select>&nbsp;
                    <select id="city" class="graybox" name="city" size=1>
                        <option value="0">城市&nbsp;&nbsp;&nbsp;</option>

                    </select>&nbsp;
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <br/>
                    <input class="btn" type="submit" value="注册" />
                </td>
            </tr>
            <tr>
                <td></td>
                <td id="feedback"><br></td>
            </tr>

            </table>
            </form>
        </td>
        <td valign="top">
        <div class="box" cellpadding="4">
            <br>友情提示：<br><br>
            1. 填写左侧注册表单，按"注册"，完成提交。<br><br>
            2. 查看你的email地址, 点击确认信中的链接。<br><br>
            欢迎你的加入。<br><br>
        </div>
        </td>
    </tr>

</table>
<br style="clear:both;" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1240467-2";
urchinTracker();
</script>
<br/>
</body>
</html>

